﻿using JustWPFControls.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace JustWPFControls.Controls
{
    [TemplatePart(Name = "PART_Drip",Type = typeof(Ellipse))]
    [TemplatePart(Name = "PART_DripScale", Type = typeof(ScaleTransform))]
    public class JButton : Button
    {
        #region 依赖属性

        /// <summary>
        /// 按钮类型
        /// </summary>
        public ButtonType Type
        {
            get { return (ButtonType)GetValue(TypeProperty); }
            set { SetValue(TypeProperty, value); }
        }
        public static readonly DependencyProperty TypeProperty =
            DependencyProperty.Register("Type", typeof(ButtonType), typeof(JButton), new PropertyMetadata(ButtonType.Filled));


        public JColor Color
        {
            get { return (JColor)GetValue(ColorProperty); }
            set { SetValue(ColorProperty, value); }
        }
        public static readonly DependencyProperty ColorProperty =
            DependencyProperty.Register("Color", typeof(JColor), typeof(JButton), new PropertyMetadata(JColor.Default));
        public IconType StartIcon
        {
            get { return (IconType)GetValue(StartIconProperty); }
            set { SetValue(StartIconProperty, value); }
        }
        public static readonly DependencyProperty StartIconProperty =
            DependencyProperty.Register("StartIcon", typeof(IconType), typeof(JButton), new PropertyMetadata(default));
        public IconType EndIcon 
        {
            get { return (IconType)GetValue(EndIconProperty); }
            set { SetValue(EndIconProperty, value); }
        }
        public static readonly DependencyProperty EndIconProperty =
            DependencyProperty.Register("EndIcon", typeof(IconType), typeof(JButton), new PropertyMetadata(default));
        #endregion

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
        }

        static JButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(JButton), new FrameworkPropertyMetadata(typeof(JButton)));
        }
    }
}
